﻿@model Scorecard

<form name="scoreVert" id="scoreVert" role="form" action="~/Score/Create" method="POST">
    @Html.AntiForgeryToken()

    @Html.HiddenFor(x => x.Id)
    @Html.HiddenFor(x => x.RoundId)
    @Html.HiddenFor(x => x.TeeId)
    @Html.HiddenFor(x => x.PlayerId)
    @Html.HiddenFor(x => x.Handicap)

    <input type="hidden" id="PlayingHandicap" value="@Model.GetPlayingHcp()">

    <table class="scoreVertical">
        <colgroup>
            <col />
            <col />
            <col />
            <col />
            <col class="strokes" />
            <col class="putts" />
        </colgroup>
        <thead>
            <tr>
                <td colspan="6">
                    <sup>Navn</sup>
                    <div class="pencilfont">@Model.Player.DisplayName</div>
                </td>
            </tr>
            <tr>
                <th>Hul</th>
                <th>Par</th>
                <th>Idx</th>
                <th>sph</th>
                <th colspan="2" class="pencilfont">@Model.Player.Initials</th>
            </tr>
        </thead>
        <tbody class="text-center">
            @for (int i = 1; i < 19; i++)
            {
                <tr>
                    <td>@i</td>
                    <td>@Model.Tee.GetPar(i)</td>
                    <td>@Model.Tee.GetIdx(i)</td>
                    <td class="pencilfont">@Model.GetSPHString(i)</td>
                    <td><input required name="@("S" + i)" tabindex="@i" type="number" min="1" max="15" size="2" value="@Model.GetStrokesForHole(i)"></td>
                    <td><input required name="@("P" + i)" tabindex="@(i+18)" type="number" min="0" max="14" size="2" value="@Model.GetPuttsForHole(i)"></td>
                </tr>
            }
        </tbody>
        <tfoot>
            <tr>
                <td>Ind</td>
                <td>@Model.Tee.ParIn</td>
                <td></td>
                <td></td>
                <td><div id="inStrokes"></div></td>
                <td><div id="inPutts"></div></td>
            </tr>
            <tr>
                <td>Ud</td>
                <td>@Model.Tee.ParOut</td>
                <td></td>
                <td></td>
                <td><div id="outStrokes"></div></td>
                <td><div id="outPutts"></div></td>
            </tr>
            <tr>
                <td>Tot</td>
                <td>@(Model.Tee.ParIn + Model.Tee.ParOut)</td>
                <td></td>
                <td></td>
                <td><div id="totalStrokes"></div></td>
                <td><div id="totalPutts"></div></td>
            </tr>
            <tr>
                <td colspan="4">Handicap</td>
                <td>@Model.GetPlayingHcp()</td>
                <td></td>
            </tr>
            <tr>
                <td colspan="4">Nettoscore</td>
                <td><div id="netto"></div></td>
                <td></td>
            </tr>
        </tfoot>
    </table>
</form>
